// indattach/hdall/hdall.js
const app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        actalls: '',
        num:8,
        zlenght:Number,
        show:false
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        var that=this;
        wx.showLoading({
            title: '加载中...',
        })
        app.comrequest('https://ipass.cc/myapi/activity2.php',{num:that.data.num}).then(res=>{
        that.setData({
            actalls:res.data,
            zlenght:res.zlenght[0].zlenght
        })
        wx.hideLoading()
        })
    },
    officskip(e) {
        var official = e.currentTarget.dataset.official;
        wx.navigateTo({
            url: '../../officialacc/account1/account1?official=' + official
        })
    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {
        var that=this;
        var zlenght=that.data.zlenght;
        var cfnum=that.data.num;
        if(cfnum>zlenght){
            that.setData({
                num:zlenght,
                show:true
            })
        }else{
            var cfnum2=cfnum+8
            that.setData({
                num:cfnum2
            })
        }
        app.comrequest('https://ipass.cc/myapi/activity2.php',{num:that.data.num}).then(res=>{
        that.setData({
            actalls:res.data
        })
        })
    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    }
})